<?php

namespace app\common\model;

use think\exception\DbException;
use think\Model;
use think\Paginator;

/**
 * 人工答疑
 */
class Manual extends Model
{
    protected $name = 'manual';













    /**
     * 人工答疑列表  教师端
     */
    public function getListManual($where = [], $teacher_id = 0)
    {
        $list =  self::alias('m')
            ->join('user u', 'u.id=m.user_id')
            ->field('m.*,u.nickname,u.avatar')
            ->where(function ($query) use ($where, $teacher_id) {
                if (isset($where['status']) && $where['status'] != '') {
                    $query->where('m.status', $where['status']);
                }
                $query->where('m.teacher_id', $teacher_id);
            })->select();
        return $list;
    }
}
